desktop_dir = $(datarootdir)/applications
source = sandcat.desktop.in
target = sandcat.desktop
sh = desktop-installer.sh

all-local:
	./$(sh) --ui=@ui@ --output=@output@

install-data-hook:
	if [ -e $(target) ]; \
	then cp -rf $(target) $(desktop_dir); \
	fi

	if [ ! -e $(pkgdatadir) ]; \
	then mkdir $(pkgdatadir); \
	fi

	cp -rf $(sh) $(pkgdatadir)
	cp -rf $(source) $(pkgdatadir)

uninstall-hook:
	cd $(desktop_dir) && rm -f $(target)

EXTRA_DIST = $(source) $(sh)